home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / ucrasm27.zip / TEST.ZIP / TSTCPUID.ASM < prev   
Assembly Source File  |  1991-10-24  |  2KB  |  127 lines

  1.         include        stdlib.a
  2.         includelib     stdlib.lib
  3. ;****************************************************************************
  4. ;
  5. ; T  E  S  T       S  U  I  T  E      F  O  R
  6. ;
  7. ;
  8. ; R  A  N  D  Y      H  Y  D  E ' S     S  T  A  N  D  A  R  D
  9. ;
  10. ; L  I  B  R  A  R  Y     F  O  R     A  S  S  E  M  B  L  Y
  11. ;
  12. ; L  A  N  G  U  A  G  E     P  R  O  G  R  A  M  M  E  R  S
  13. ;
  14. ;****************************************************************************
  15. ;
  16. ;
  17. ; Global variables go here:
  18. ;
  19. StdData        segment    para public 'sldata'
  20.         extrn    fpacc:byte
  21. StdData        ends
  22. ;
  23. ;
  24. dseg        segment    para public 'data'
  25. ;
  26. MemAvail    dw    ?
  27. dseg        ends
  28. ;
  29. ;
  30. ;
  31. ;
  32. cseg        segment    para public 'code'
  33.         assume    cs:cseg, ds:dseg
  34. ;
  35. ;
  36. lesi        macro    adrs
  37.         mov     di, seg adrs
  38.         mov    es, di
  39.         lea    di, adrs
  40.         endm
  41. ;
  42. ldxi        macro    adrs
  43.         mov    dx, seg adrs
  44.         lea    si, adrs
  45.         endm
  46. ;
  47. ; Variables that wind up being used by the standard library routines.
  48. ; The MemInit routine uses "PSP" and "zzzzzzseg" labels.  They must be
  49. ; present if you intend to use getenv, MemInit, malloc, and free.
  50. ;
  51. ;
  52.         public    PSP
  53. PSP        dw    ?
  54. ;
  55. cr        equ    13
  56. lf        equ    10
  57. ;
  58. ;
  59. ; Main is the main program.  Program execution always begins here.
  60. ;
  61. Main        proc
  62.         mov    cs:PSP, es        ;Save pgm seg prefix
  63.         mov    ax, seg dseg        ;Set up the segment registers
  64.         mov    ds, ax
  65.         mov    es, ax
  66.         mov    dx, 0            ;Allocate all available RAM.
  67.         MemInit
  68.         mov    MemAvail, cx
  69.         printf
  70.         db    "There are %x paragraphs of memory available."
  71.         db    cr,lf,lf,0
  72.         dd    MemAvail
  73. ;
  74. ;
  75. ;
  76. ;***************************************************************************
  77. ;
  78.         print
  79.         db    "This machine has an ",0
  80.         cpuid
  81.         putu
  82.         print
  83.         db    " processor and ",0
  84.         mov    ax, bx
  85.         cmp    ax, 0
  86.         jnz    PutFPU
  87.         print
  88.         db    "no",0
  89.         jmp    DoIt
  90. ;
  91. PutFPU:        print
  92.         db    "an ",0
  93.         putu
  94. ;
  95. DoIt:        print
  96.         db    " FPU",cr,lf,0
  97. ;
  98. ;
  99. ;***************************************************************************
  100. ;
  101. Quit:        mov     ah, 4ch
  102.         int     21h
  103. ;
  104. ;
  105. Main        endp
  106. ;
  107. ;
  108. ;
  109. cseg            ends
  110. ;
  111. ;
  112. ; Allocate a reasonable amount of space for the stack (2k).
  113. ;
  114. sseg        segment    para stack 'stack'
  115. stk        db    256 dup ("stack   ")
  116. sseg        ends
  117. ;
  118. ;
  119. ;
  120. ; zzzzzzseg must be the last segment that gets loaded into memory!
  121. ;
  122. zzzzzzseg    segment    para public 'zzzzzz'
  123. LastBytes    db    16 dup (?)
  124. heap        db    1024 dup (?)
  125. zzzzzzseg    ends
  126.         end    Main
  127.